<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="extLibs" value="validate"/>
<sys:header title="意见建议管理 - ${inbox.isNewRecord ? '新增' : '编辑'}意见建议" extLibs="${extLibs}"/>
<div class="portlet box ${boxStyleColor} autoHeight">
	<div class="portlet-title">
		<div class="caption"><i class="fa fa-coffee"></i>${inbox.isNewRecord ? '新增' : '编辑'}意见建议</div>
		<%-- <div class="actions">
			<shiro:hasPermission name="ums:inbox:edit">
				<a href="#" class="btn btn-default btn-sm" onclick="$('#btnSubmit').click();return false;"><i class="fa fa-check"></i> 保 存</a>
			</shiro:hasPermission>
			<a href="#" class="btn btn-default btn-sm" onclick="$('#btnCancel').click();return false;"><i class="fa fa-reply-all"></i> 关 闭</a>
		</div> --%>
	</div>
	<div class="portlet-body form">
		<form:form id="inputForm" modelAttribute="inbox" action="${ctx}/ums/inbox/save" method="post" class="form-horizontal">
			<div class="form-body">
				<h4 class="form-section">基本信息</h4>
				<form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								标题：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<form:input path="title" htmlEscape="false" maxlength="64" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								类别：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<form:select path="category" multiple="false" class="form-control required input-sm"  >
									<form:options items="${fns:getDictList('inbox_category')}" itemLabel="name" itemValue="name" htmlEscape="false"/>
								</form:select>
							</div>
						</div>
					</div>
				</div>
				
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								收件人：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<sys:listselect id="member" name="memberCode" value="${inbox.memberCode}" labelName="memberName" labelValue="${inbox.memberName}"
												title="会员" url="${ctx}/mdm/member/memberSelect" multiple="false"  cssClass="form-control required" />
							</div>
						</div>
					</div>
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								意见建议：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<form:textarea path="content" htmlEscape="false" rows="4" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								备注信息：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="form-actions fluid">
				<div class="row">
					<div class="col-xs-12">
						<div class="col-sm-offset-2 col-sm-10">
							<shiro:hasPermission name="ums:inbox:edit">
								<button id="btnSubmit" type="submit" class="btn btn-primary"><i class="fa fa-check"></i> 保 存</button>&nbsp;
							</shiro:hasPermission>
							<button id="btnCancel" type="button" class="btn default" onclick="closeCurrentTabPage('${param.parentTabPageId}')"><i class="fa fa-reply-all"></i> 关 闭</button>
						</div>
					</div>
				</div>
			</div>
		</form:form>
	</div>
</div>
<sys:footer extLibs="${extLibs}"/>
<script type="text/javascript">

	//会员选择回调
	function memberCallbackForMap(dataMap, v, h, f){
		var codes = [], names = [],mobiles=[];
		$.each(dataMap, function(key, value){
			codes.push(value.memberCode);
			names.push(value.memberName);
			mobiles.push(value.phone);
	
		});
		$('#memberCode').val(codes.join(','));
		$('#memberName').val(names.join(','));
	}
	$("#inputForm").validate({
		submitHandler: function(form){
			ajaxSubmitForm($(form), function(data){
				showMessage(data.message);
				if(data.result == Global.TRUE){
					closeCurrentTabPage('${param.parentTabPageId}', function(contents, contentWindow){
						contentWindow.page();
					});
				}
			}, "json");
	    }
	});
</script>